using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace Genuilder.GUI
{
	/// <summary>
	/// Interaction logic for Window1.xaml
	/// </summary>
	public partial class Window1 : Window
	{
		public Window1()
		{
			InitializeComponent();
			ViewModel = new GenuilderViewModel();
		}
		public GenuilderViewModel ViewModel
		{
			get
			{
				return (GenuilderViewModel)GetValue(ViewModelProperty);
			}
			set
			{
				SetValue(ViewModelProperty, value);
			}
		}
		public static readonly DependencyProperty ViewModelProperty =
			DependencyProperty.Register("ViewModel", typeof(GenuilderViewModel), typeof(Window1), new UIPropertyMetadata()
			{
				PropertyChangedCallback = new PropertyChangedCallback(ViewModelChanged)
			});
		private static void ViewModelChanged(DependencyObject obj, DependencyPropertyChangedEventArgs args)
		{
			Window1 tree = obj as Window1;
			tree.root.DataContext = args.NewValue;
		}
	}
}
